home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 3 / The Arsenal Files 3.iso / gen_prog / appdemo.exe / DEMOTSR1.APP < prev    next >
Text File  |  1994-11-07  |  975b  |  48 lines

  1. #include "FILEIO.APP"
  2. #include "TSR.APP"
  3. #include "API.APP"
  4. #include "STRING.APP"
  5. #include "MAINLIB.APP"  // MAINLIB.APP must always be last #include
  6.  
  7. // This TSR displays a file when you press ALT V
  8.  
  9. .STACKSIZE 2000
  10. .STRINGHEAPSIZE 1000
  11.  
  12. int Main()
  13. {
  14.  cout << "Press ALT V to view a file at any time\n";
  15.  TSRWithHotKey(2Fh,0,0,1,64); // ALT V Hot Key and reserve 64k dynamic RAM
  16.  return 0;
  17. }
  18.  
  19.  
  20. void TSRMain()
  21. {
  22.  int    ViewFile;
  23.  string Line;
  24.  
  25.  Vdu.BackgroundColor = BLUE;
  26.  Vdu.ForegroundColor = YELLOW;
  27.  DrawBox(10,5,70,20);
  28.  Vdu.MinCol = 11;
  29.  Vdu.MinRow = 6;
  30.  Vdu.MaxCol = 69;
  31.  Vdu.MaxRow = 19;
  32.  
  33.  cout << "File to view = ";
  34.  Line = InputLineWithDefault("DEMOTSR1.APP");
  35.  ViewFile = Open(Line, READ);
  36.  if(!ViewFile) { cout << "Could not open " << Line << "\n"; End(179); }
  37.  while(!EOF(ViewFile))
  38.  {
  39.   ViewFile >> Line;
  40.   cout << Line << "\n";
  41.  }
  42.  Close(ViewFile);
  43.  cout << "Please hit a key to continue";
  44.  GetChar(cin);
  45. }
  46.  
  47.  
  48.